<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<meta http-equiv="X-UA-Compatible" content="ie=edge" />
	<meta name="renderer" content="webkit">
	<meta http-equiv="Pragma" content="no-cache">
	<meta http-equiv="Cache-Control" content="no-cache">
	<meta http-equiv="Expires" content="0">
	<title>商品详情</title>
	<!-- <link href="plugin/date/date.css" rel="stylesheet"> -->
	<!-- <link href="bootstrap/css/bootstrap3.min.css" rel="stylesheet"> -->
	<link rel="stylesheet" href="../../css/normalize.min.css">
	<link rel="stylesheet" href="../../css/common.css">
	<!-- <link rel="stylesheet" href="../../css/bootstrap.cerulean.css"> -->
	<link rel="stylesheet" href="../../css/bootstrap.cosmo.css">
	<!-- <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> -->
	<script src="../../js/jquery.min.js"></script>
	<!-- <link rel="stylesheet" href="css/nav.css" /> -->
	<style>
		.form-group-update {
			margin-right: 2%;
		}

		#bannerImg,
		#classificationImg {
			display: none;
		}

		.goodsBody {
			width: 90%;
			margin: 0 auto;
		}

		.goodsBody img {
			width: 100%;
		}

		#dataList th {
			min-width: 100px;
		}

		.goodsBody img {
			width: 600px;
			margin: 0 auto;
			display: block;
		}
	</style>
</head>

<body>
	<!--导航-->
	<div class="configNav"></div>

	<div class="container-fluid">
		<div class="row bcert-box">
			<ol class="breadcrumb">
				<li><a href="javascript:;">主页</a></li>
				<li>商品管理</li>
				<li class="active">商品详情</li>
			</ol>
			<div style="max-width: 1000px;margin: 0 auto;">
				<table class="table table-bordered table-striped" id="dataList">
					<tbody></tbody>
				</table>
			</div>

		</div>
	</div>
</body>

</html>
<script type="text/javascript" src="../../plugin/layer/layer.js"></script>
<script type="text/javascript" src="../../js/jquery.cookie.js"></script>
<script type="text/javascript" src="../../js/common.js"></script>
<script src="../../js/nav.js" charset="utf-8"></script>
<script type="text/javascript" src="../../js/ajax.js"></script>
<script type="text/javascript" src="../../js/bootstrap-paginator.js"></script>
<script type="text/javascript" src="../../js/bootstrap.min.js"></script>
<script>
	function getQueryString(key) {
		var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
		var result = window.location.search.substr(1).match(reg);
		return result ?
			decodeURIComponent(result[2]) :
			null;
	}
	$(document).ready(function() {
		var id = getQueryString('id')
		data = {
			'goodsId': id,
		}
		var url = serverURL + '/goods/queryGoodsDetail';
		var cbk = function(res) {
			html =
				'<tr><th>商品id</th>' +
				'<td>' + res.data.goodsId + '</td>' +
				'</tr><tr><th>商品名称</th>' +
				'<td>' + res.data.goodsName + '</td>' +
				'</tr><tr><th>店铺名称</th>' +
				'<td>' + res.data.storeName + '</td>' +
				'</tr><tr><th>商品分类</th>' +
				'<td>' + res.data.gcId1 + '——' + res.data.gcId2 + '——' + res.data.gcId3 + '</td>' +
				'</tr><tr><th>商品价格</th>' +
				'<td>' + res.data.goodsPrice + '</td>' +
				'</tr><tr><th>市场价</th>' +
				'<td>' + res.data.goodsMarketprice + '</td>' +
				'</tr><tr><th>库存</th>' +
				'<td>' + res.data.goodsStorage + '</td>' +
				'</tr><tr><th>运费</th>' +
				'<td>' + res.data.goodsFreight + '</td>' +
				'</tr><tr><th>物券价格</th>' +
				'<td>' + res.data.couponPrice + '</td>' +
				'</tr><tr><th>商品主图</th>'
			if (res.data.storeId == 7) {
				html += '<td><img src="' + res.data.goodsImage + '" width="300" /></td>'
			} else {
				html += '<td><img src="http://axyhpic.oss-cn-zhangjiakou.aliyuncs.com/' + res.data.goodsImage + '" width="300" /></td>'
			}

			html += '</tr><tr><th>商品描述</th>' +
				'<td>11</td>' +
				'</tr><tr><th style="vertical-align: top;">商品详情</th>' +
				'<td><div class="goodsBody">' + res.data.goodsBody + '</div></td>' +
				'</tr>'
			$('#dataList tbody').append(html)
		}
		ajax(
			url,
			data,
			cbk,
			'post',
			'json'
		)
	});
</script>
